package com.tao.config;

import org.apache.ibatis.mapping.DatabaseIdProvider;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;

/**
 * @ClassName MyDatabaseMetaData
 * @Author HETAO
 * @Date 2020/7/25 22:45
 */
public class MyDatabaseMetaData implements DatabaseIdProvider {
    @Override
    public void setProperties(Properties p) {
        p.stringPropertyNames().forEach(System.out::println);
    }

    @Override
    public String getDatabaseId(DataSource dataSource) throws SQLException {
        Connection connection = dataSource.getConnection();
        System.out.println(connection);
        return null;
    }
}
